import { Component,OnInit } from '@angular/core';
import { Title } from '@angular/platform-browser';

var mojs = require('mojs');

@Component({
	selector: 'my-app',
	template: `
		<router-outlet></router-outlet>
	`
})
export class AppComponent implements OnInit{
	public constructor( private titleService: Title ){
		this.titleService.setTitle('~HF Bearing~')
	}

	ngOnInit() {
		const burst = new mojs.Burst({
			left: 0, top: 0,
			radius:   { 4: 19 },
			angle:    45,
			children: {
				shape:        'line',
				radius:       3,
				scale:        1,
				stroke:       '#FD7932',
				strokeDasharray: '100%',
				strokeDashoffset: { '-100%' : '100%' },
				duration:     700,
				easing:       'quad.out',
			}
		});

        document.addEventListener('click',function(e){
            burst.tune({ x: e.pageX, y: e.pageY })
                .generate()
                .replay();
		})
	}
}